cmake_minimum_required(VERSION 3.4.1)

# build vulkan app
set(SRC_DIR src/main/jni)
LINK_DIRECTORIES(src/jniLibs/${ANDROID_ABI})

add_library(
        vktuts
        SHARED
        ${SRC_DIR}/VulkanMain.cpp
        ${SRC_DIR}/AndroidMain.cpp
        ${SRC_DIR}/android_native_app_glue.c
        ${SRC_DIR}/vulkan_wrapper.cpp)

add_library(
        sdk
        SHARED
        IMPORTED
)
set_target_properties(sdk
        PROPERTIES
        IMPORTED_LOCATION
        src/jniLibs/${ANDROID_ABI}/libPvr_NativeSDK.so
        )

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror \
                     -DVK_USE_PLATFORM_ANDROID_KHR")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
target_link_libraries(vktuts log android)
